import java.io.*;
import java.lang.Math;

public class Test16 {
    public static void main(String[] args) throws IOException {
        long time = System.currentTimeMillis();

        String fileName = "D:\\Java\\randomNumbers2.txt";

        FileWriter out = new FileWriter(fileName);

        for (int i = 0; i < 100000; i++) {
            out.write((int)(Math.random() * 1000) + "\n");
//            System.out.println((int)(Math.random() * 1000));

        }

        out.close();

        time = System.currentTimeMillis() - time;
        System.out.println("Time elapsed:" + time);


//        FileReader in = new FileReader(fileName);
//
//        int line = in.read();
//
//        while (line != -1) {
//            System.out.println(line);
//            line = in.read();
//        }
//
//        in.close();
    }
}
